<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:10pt; font-weight:400; font-style:normal;">
<p style=" margin-top:0px; margin-bottom:10px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:11pt; font-weight:600;">VBA Excel. Вставка рисунка в ячейку</span></p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:11pt; font-style:italic;">Вставка существующего рисунка (фигуры, другого объекта) в ячейку Excel с помощью кода VBA. Подгон ячейки под размеры рисунка и фигуры под размеры ячейки.</span></p>
<p style=" margin-top:32px; margin-bottom:6px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#fafafa;"><span style=" font-family:'DejaVu Sans'; font-size:11pt; font-weight:600; color:#333333;">Содержание</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="https://vremya-ne-zhdet.ru/vba-excel/vstavka-risunka-v-yacheyku/#Podgon_acejki_pod_razmery_risunka"><span style=" font-family:'DejaVu Sans'; font-size:11pt; text-decoration: underline; color:#0000ff;">1. Подгон ячейки под размеры рисунка</span></a></p>
<p style=" margin-top:2px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="https://vremya-ne-zhdet.ru/vba-excel/vstavka-risunka-v-yacheyku/#Podgon_figury_pod_razmery_acejki"><span style=" font-family:'DejaVu Sans'; font-size:11pt; text-decoration: underline; color:#0000ff;">2. Подгон фигуры под размеры ячейки</span></a></p>
<p style=" margin-top:2px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="https://vremya-ne-zhdet.ru/vba-excel/vstavka-risunka-v-yacheyku/#Konstanty_iz_kollekcii_XlPlacement"><span style=" font-family:'DejaVu Sans'; font-size:11pt; text-decoration: underline; color:#0000ff;">3. Константы из коллекции XlPlacement</span></a></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'DejaVu Sans'; font-size:11pt; text-decoration: underline; color:#0000ff;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier New'; color:#0000ff;">Sub</span><span style=" font-family:'Courier New'; color:#000000;"> Primer2</span><span style=" font-family:'Courier New'; font-weight:600; color:#000000;">()</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier New'; color:#000000;">    </span><span style=" font-family:'Courier New'; color:#0000ff;">Dim</span><span style=" font-family:'Courier New'; color:#000000;"> i </span><span style=" font-family:'Courier New'; color:#0000ff;">As</span><span style=" font-family:'Courier New'; color:#000000;"> </span><span style=" font-family:'Courier New'; color:#0000ff;">Byte</span><span style=" font-family:'Courier New'; font-weight:600; color:#000000;">,</span><span style=" font-family:'Courier New'; color:#000000;"> n          </span><span style=" font-family:'Courier New'; color:#0000ff;">As</span><span style=" font-family:'Courier New'; color:#000000;"> </span><span style=" font-family:'Courier New'; color:#0000ff;">Single</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier New'; color:#000000;">    </span><span style=" font-family:'Courier New'; color:#0000ff;">For</span><span style=" font-family:'Courier New'; color:#000000;"> </span><span style=" font-family:'Courier New'; color:#0000ff;">Each</span><span style=" font-family:'Courier New'; color:#000000;"> oShape </span><span style=" font-family:'Courier New'; color:#0000ff;">In</span><span style=" font-family:'Courier New'; color:#000000;"> ActiveSheet.Shapes</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier New'; color:#000000;">        </span><span style=" font-family:'Courier New'; color:#0000ff;">With</span><span style=" font-family:'Courier New'; color:#000000;"> ActiveSheet</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier New'; color:#000000;">            </span><span style=" font-family:'Courier New'; color:#008000;">'Set oShape = .Shapes(i)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier New'; color:#000000;">            Debug.Print oShape.Name</span><span style=" font-family:'Courier New'; font-weight:600; color:#000000;">,</span><span style=" font-family:'Courier New'; color:#000000;"> </span><span style=" font-family:'Courier New'; font-weight:600; color:#000000;">.</span><span style=" font-family:'Courier New'; color:#000000;">Cells</span><span style=" font-family:'Courier New'; font-weight:600; color:#000000;">(</span><span style=" font-family:'Courier New'; color:#000000;">oShape.BottomRightCell.Row</span><span style=" font-family:'Courier New'; font-weight:600; color:#000000;">,</span><span style=" font-family:'Courier New'; color:#000000;"> oShape.BottomRightCell.Column</span><span style=" font-family:'Courier New'; font-weight:600; color:#000000;">).</span><span style=" font-family:'Courier New'; color:#000000;">Address</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier New'; color:#000000;">            </span><span style=" font-family:'Courier New'; color:#0000ff;">Set</span><span style=" font-family:'Courier New'; color:#000000;"> rCell </span><span style=" font-family:'Courier New'; font-weight:600; color:#000000;">=</span><span style=" font-family:'Courier New'; color:#000000;"> </span><span style=" font-family:'Courier New'; font-weight:600; color:#000000;">.</span><span style=" font-family:'Courier New'; color:#000000;">Cells</span><span style=" font-family:'Courier New'; font-weight:600; color:#000000;">(</span><span style=" font-family:'Courier New'; color:#000000;">oShape.BottomRightCell.Row </span><span style=" font-family:'Courier New'; font-weight:600; color:#000000;">-</span><span style=" font-family:'Courier New'; color:#000000;"> </span><span style=" font-family:'Courier New'; font-weight:600; color:#ff0000;">1</span><span style=" font-family:'Courier New'; font-weight:600; color:#000000;">,</span><span style=" font-family:'Courier New'; color:#000000;"> </span><span style=" font-family:'Courier New'; font-weight:600; color:#ff0000;">3</span><span style=" font-family:'Courier New'; font-weight:600; color:#000000;">)</span><span style=" font-family:'Courier New'; color:#000000;">    </span><span style=" font-family:'Courier New'; color:#008000;">'.Value</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier New'; color:#000000;">            </span><span style=" font-family:'Courier New'; color:#008000;">'rCell.Show</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier New'; color:#000000;">            </span><span style=" font-family:'Courier New'; color:#008000;">'определяем, во сколько раз будет изменена высота рисунка</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier New'; color:#000000;">            n </span><span style=" font-family:'Courier New'; font-weight:600; color:#000000;">=</span><span style=" font-family:'Courier New'; color:#000000;"> oShape.Height </span><span style=" font-family:'Courier New'; font-weight:600; color:#000000;">/</span><span style=" font-family:'Courier New'; color:#000000;"> rCell.Height</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier New'; color:#000000;">            oShape.Placement </span><span style=" font-family:'Courier New'; font-weight:600; color:#000000;">=</span><span style=" font-family:'Courier New'; color:#000000;"> xlMoveAndSize</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier New'; color:#000000;">            oShape.LockAspectRatio </span><span style=" font-family:'Courier New'; font-weight:600; color:#000000;">=</span><span style=" font-family:'Courier New'; color:#000000;"> msoFalse</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier New'; color:#000000;">            </span><span style=" font-family:'Courier New'; color:#008000;">'изменяем высоту рисунка до высоты ячейки</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier New'; color:#000000;">            oShape.Height </span><span style=" font-family:'Courier New'; font-weight:600; color:#000000;">=</span><span style=" font-family:'Courier New'; color:#000000;"> rCell.Height</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier New'; color:#000000;">            </span><span style=" font-family:'Courier New'; color:#008000;">'изменяем ширину рисунка пропорционально изменению его высоты</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier New'; color:#000000;">            </span><span style=" font-family:'Courier New'; color:#008000;">'oShape.Width = oShape.Width / n</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier New'; color:#000000;">            oShape.Width </span><span style=" font-family:'Courier New'; font-weight:600; color:#000000;">=</span><span style=" font-family:'Courier New'; color:#000000;"> rCell.Width</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier New'; color:#000000;">            </span><span style=" font-family:'Courier New'; color:#008000;">'выравниваем рисунок по левому краю ячейки</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier New'; color:#000000;">            oShape.Left </span><span style=" font-family:'Courier New'; font-weight:600; color:#000000;">=</span><span style=" font-family:'Courier New'; color:#000000;"> rCell.Left</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier New'; color:#000000;">            </span><span style=" font-family:'Courier New'; color:#008000;">'выравниваем рисунок по верхнему краю ячейки</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier New'; color:#000000;">            oShape.Top </span><span style=" font-family:'Courier New'; font-weight:600; color:#000000;">=</span><span style=" font-family:'Courier New'; color:#000000;"> rCell.Top</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier New'; color:#000000;">        </span><span style=" font-family:'Courier New'; color:#0000ff;">End</span><span style=" font-family:'Courier New'; color:#000000;"> </span><span style=" font-family:'Courier New'; color:#0000ff;">With</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier New'; color:#000000;">    </span><span style=" font-family:'Courier New'; color:#0000ff;">Next</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier New'; color:#0000ff;">End</span><span style=" font-family:'Courier New'; color:#000000;"> </span><span style=" font-family:'Courier New'; color:#0000ff;">Sub</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="Podgon_acejki_pod_razmery_risunka"></a><span style=" font-family:'DejaVu Sans'; font-size:11pt; font-weight:600;">П</span><span style=" font-family:'DejaVu Sans'; font-size:11pt; font-weight:600;">одгон ячейки под размеры рисунка</span></p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:11pt;">Вставка рисунка в ячейку из кода VBA Excel с подгоном размеров ячейки под размеры фигуры (картинки).</span></p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:11pt;">Сложность заключается в том, что высота и ширина рисунка (фигуры) и высота ячейки измеряются в точках (пунктах), а </span><a href="https://vremya-ne-zhdet.ru/vba-excel/razmer-yacheyki-vysota-stroki-shirina-stolbtsa-avtopodbor/"><span style=" font-family:'DejaVu Sans'; font-size:11pt; text-decoration: underline; color:#0000ff;">ширина ячейки</span></a><span style=" font-family:'DejaVu Sans'; font-size:11pt;"> (ширина столбца) измеряется в символах.</span></p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:11pt;">Хороший результат при вставке в ячейку небольших изображений дает приравнивание одного символа к пяти точкам.</span></p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:11pt;">Код VBA Excel для вставки рисунка в ячейку с подгоном размеров ячейки под размеры фигуры (картинки):</span></p>
<p style="-qt-paragraph-type:empty; margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Verdana,Arial,sans'; font-size:11pt; font-weight:496; background-color:#fdfdfd;"><br /></p>
<table border="0" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" cellspacing="2" cellpadding="0">
<tr>
<td bgcolor="#dfefff" style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;"></td>
<td style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-650182d1cade8913946735-1"></a><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#800080;">S</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#800080;">ub</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#004ed0;">Primer1</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">()</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-650182d1cade8913946735-2"></a><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;">   </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#800080;">With</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#000000;">Лист</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#ce0000;">20</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-650182d1cade8913946735-3"></a><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;">       </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#004ed0;">Shapes</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#008000;">&quot;Рисунок 1&quot;</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">).</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#002d7a;">Placement</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> = </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#000000;">xlMove</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-650182d1cade8913946735-4"></a><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;">       </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#ff8000;">'изменяем ширину ячейки (столбца) в символах до 1/5 ширины рисунка в пунктах</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-650182d1cade8913946735-5"></a><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;">       </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#004ed0;">Range</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#008000;">&quot;B3&quot;</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">).</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#002d7a;">ColumnWidth</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> = </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#004ed0;">Shapes</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#008000;">&quot;Рисунок 1&quot;</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">).</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#002d7a;">Width</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> / </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#ce0000;">5</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-650182d1cade8913946735-6"></a><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;">       </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#ff8000;">'изменяем высоту ячейки (строки) до высоты рисунка + 10 точек для отступов</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-650182d1cade8913946735-7"></a><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;">       </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#004ed0;">Range</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#008000;">&quot;B3&quot;</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">).</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#002d7a;">RowHeight</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> = </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#004ed0;">Shapes</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#008000;">&quot;Рисунок 1&quot;</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">).</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#002d7a;">Height</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> + </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#ce0000;">10</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-650182d1cade8913946735-8"></a><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;">       </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#ff8000;">'задаем отступ рисунка от левого края ячейки на 5 пунктов</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-650182d1cade8913946735-9"></a><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;">       </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#004ed0;">Shapes</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#008000;">&quot;Рисунок 1&quot;</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">).</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#002d7a;">Left</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> = </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#004ed0;">Range</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#008000;">&quot;B3&quot;</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">).</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#002d7a;">Left</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> + </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#ce0000;">5</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-650182d1cade8913946735-10"></a><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;">       </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#ff8000;">'задаем отступ рисунка от верхнего края ячейки на 5 пунктов</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-650182d1cade8913946735-11"></a><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;">       </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#004ed0;">Shapes</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#008000;">&quot;Рисунок 1&quot;</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">).</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#002d7a;">Top</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> = </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#004ed0;">Range</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#008000;">&quot;B3&quot;</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">).</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#002d7a;">Top</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> + </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#ce0000;">5</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-650182d1cade8913946735-12"></a><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;">   </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#800080;">End</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#800080;">With</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-650182d1cade8913946735-13"></a><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#800080;">E</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#800080;">nd</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#800080;">Sub</span></p></td></tr></table>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:11pt;">Свойству Placement объекта Shapes присваиваем значение константы xlMove, которое задает возможность перемещать рисунок вместе с ячейками, но не изменять его размеры при изменении размеров ячеек. Доступные константы из коллекции XlPlacement перечислены ниже.</span></p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:11pt;">Было:</span></p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:11pt;">Стало:</span></p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="Podgon_figury_pod_razmery_acejki"></a><span style=" font-family:'DejaVu Sans'; font-size:11pt; font-weight:600;">П</span><span style=" font-family:'DejaVu Sans'; font-size:11pt; font-weight:600;">одгон фигуры под размеры ячейки</span></p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:11pt;">Вставка рисунка в ячейку из кода VBA Excel с подгоном размеров картинки (фигуры) под размеры ячейки.</span></p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:11pt;">Чтобы сохранить пропорции рисунка при изменении его высоты до высоты ячейки, ширину картинки будем изменять во столько же раз, во сколько и высоту.</span></p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:11pt;">Код VBA Excel для вставки рисунков в ячейки с подгоном размеров картинок (фигур) под размеры ячеек:</span></p>
<p style="-qt-paragraph-type:empty; margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Verdana,Arial,sans'; font-size:11pt; font-weight:496; background-color:#fdfdfd;"><br /></p>
<table border="0" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" cellspacing="2" cellpadding="0">
<tr>
<td bgcolor="#dfefff" style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;"></td>
<td style=" vertical-align:top; padding-left:0; padding-right:0; padding-top:0; padding-bottom:0;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-650182d1cae10567512863-1"></a><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#800080;">S</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#800080;">ub</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#004ed0;">Primer2</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">()</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-650182d1cae10567512863-2"></a><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#800080;">D</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#800080;">im</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#000000;">i</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#800080;">As</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#800080;">Byte</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#000000;">n</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#800080;">As</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#800080;">Single</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-650182d1cae10567512863-3"></a><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;">   </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#800080;">For</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#002d7a;">i</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> = </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#ce0000;">1</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#800080;">To</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#ce0000;">5</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-650182d1cae10567512863-4"></a><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;">       </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#800080;">With</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#000000;">Лист</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#ce0000;">19</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-650182d1cae10567512863-5"></a><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;">           </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#ff8000;">'определяем, во сколько раз будет изменена высота рисунка</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-650182d1cae10567512863-6"></a><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;">           </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#002d7a;">n</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> = </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#004ed0;">Shapes</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#002d7a;">i</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">).</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#002d7a;">Height</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> / </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#004ed0;">Cells</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#002d7a;">i</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#ce0000;">1</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">).</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#000000;">Height</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-650182d1cae10567512863-7"></a><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;">           </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#004ed0;">Shapes</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#002d7a;">i</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">).</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#002d7a;">Placement</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> = </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#000000;">xlMove</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-650182d1cae10567512863-8"></a><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;">           </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#ff8000;">'изменяем высоту рисунка до высоты ячейки</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-650182d1cae10567512863-9"></a><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;">           </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#004ed0;">Shapes</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#002d7a;">i</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">).</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#002d7a;">Height</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> = </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#004ed0;">Cells</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#002d7a;">i</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#ce0000;">1</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">).</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#000000;">Height</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-650182d1cae10567512863-10"></a><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;">           </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#ff8000;">'изменяем ширину рисунка пропорционально изменению его высоты</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-650182d1cae10567512863-11"></a><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;">           </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#004ed0;">Shapes</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#002d7a;">i</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">).</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#002d7a;">Width</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> = </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#004ed0;">Shapes</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#002d7a;">i</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">).</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#002d7a;">Width</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> / </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#000000;">n</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-650182d1cae10567512863-12"></a><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;">           </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#ff8000;">'выравниваем рисунок по левому краю ячейки</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-650182d1cae10567512863-13"></a><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;">           </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#004ed0;">Shapes</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#002d7a;">i</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">).</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#002d7a;">Left</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> = </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#004ed0;">Cells</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#002d7a;">i</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#ce0000;">1</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">).</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#000000;">Left</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-650182d1cae10567512863-14"></a><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;">           </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#ff8000;">'выравниваем рисунок по верхнему краю ячейки</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-650182d1cae10567512863-15"></a><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;">           </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#004ed0;">Shapes</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#002d7a;">i</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">).</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#002d7a;">Top</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> = </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">.</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#004ed0;">Cells</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">(</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#002d7a;">i</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">,</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#ce0000;">1</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#333333;">).</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#004ed0;">Top</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-650182d1cae10567512863-16"></a><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#004ed0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#004ed0;">       </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#800080;">End</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#800080;">With</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="urvanov-syntax-highlighter-650182d1cae10567512863-17"></a><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;">   </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#800080;">Next</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f7f7f7;"><a name="urvanov-syntax-highlighter-650182d1cae10567512863-18"></a><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#800080;">E</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#800080;">nd</span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#006fe0;"> </span><span style=" font-family:'inherit'; font-size:11pt; font-weight:496; color:#800080;">Sub</span></p></td></tr></table>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:11pt;">Было:</span></p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:11pt;">Стало:</span></p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a name="Konstanty_iz_kollekcii_XlPlacement"></a><span style=" font-family:'DejaVu Sans'; font-size:11pt; font-weight:600;">К</span><span style=" font-family:'DejaVu Sans'; font-size:11pt; font-weight:600;">онстанты из коллекции XlPlacement</span></p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:11pt;">Константы из коллекции XlPlacement определяют реакцию рисунка, фигуры или другого объекта из группы «Иллюстрации» на перемещение и изменение размеров ячеек, над которыми рисунок расположен.</span></p>
<p style=" margin-top:0px; margin-bottom:30px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:11pt;">Описание констант из коллекции XlPlacement:</span></p>
<table border="1" style=" margin-top:0px; margin-bottom:20px; margin-left:0px; margin-right:0px;" cellspacing="2" cellpadding="0"><thead>
<tr>
<td width="25%" bgcolor="#eaeaea" style=" padding-left:20; padding-right:20; padding-top:20; padding-bottom:10;">
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:11pt; font-weight:600; background-color:#eaeaea;">Константа</span></p></td>
<td width="25%" bgcolor="#eaeaea" style=" padding-left:20; padding-right:20; padding-top:20; padding-bottom:10;">
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:11pt; font-weight:600; background-color:#eaeaea;">Значение</span></p></td>
<td width="50%" bgcolor="#eaeaea" style=" padding-left:20; padding-right:20; padding-top:20; padding-bottom:10;">
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:11pt; font-weight:600; background-color:#eaeaea;">Описание</span></p></td></tr></thead>
<tr>
<td bgcolor="#fff7ec" style=" padding-left:20; padding-right:20; padding-top:20; padding-bottom:20;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:11pt; background-color:#fff7ec;">xlMoveAndSize</span></p></td>
<td bgcolor="#fff7ec" style=" padding-left:20; padding-right:20; padding-top:20; padding-bottom:20;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:11pt; background-color:#fff7ec;">1</span></p></td>
<td bgcolor="#fff7ec" style=" padding-left:20; padding-right:20; padding-top:20; padding-bottom:20;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:11pt; background-color:#fff7ec;">Объект перемещается и изменяет размеры вместе с ячейками</span></p></td></tr>
<tr>
<td bgcolor="#fff7ec" style=" padding-left:20; padding-right:20; padding-top:20; padding-bottom:20;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:11pt; background-color:#fff7ec;">xlMove</span></p></td>
<td bgcolor="#fff7ec" style=" padding-left:20; padding-right:20; padding-top:20; padding-bottom:20;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:11pt; background-color:#fff7ec;">2</span></p></td>
<td bgcolor="#fff7ec" style=" padding-left:20; padding-right:20; padding-top:20; padding-bottom:20;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:11pt; background-color:#fff7ec;">Объект перемещается вместе с ячейками, но не изменяет размеры</span></p></td></tr>
<tr>
<td bgcolor="#fff7ec" style=" padding-left:20; padding-right:20; padding-top:20; padding-bottom:20;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:11pt; background-color:#fff7ec;">xlFreeFloating</span></p></td>
<td bgcolor="#fff7ec" style=" padding-left:20; padding-right:20; padding-top:20; padding-bottom:20;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:11pt; background-color:#fff7ec;">3</span></p></td>
<td bgcolor="#fff7ec" style=" padding-left:20; padding-right:20; padding-top:20; padding-bottom:20;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'DejaVu Sans'; font-size:11pt; background-color:#fff7ec;">Объект не перемещается и не изменяет размеры вместе с ячейками</span></p></td></tr></table>
<hr />
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#e6e6fa;"><a href="https://vremya-ne-zhdet.ru/vba-excel/soderzhaniye-rubriki/"><span style=" font-family:'DejaVu Sans'; font-size:11pt; text-decoration: underline; color:#0000ff;">Содержание рубрики VBA Excel</span></a><span style=" font-family:'DejaVu Sans'; font-size:11pt;"> по тематическим разделам со ссылками на все статьи.</span></p></body></html>